//一种:  Promise 链式调用
//二种:  Promise.all
//三种:  async await
//引入模块
const fs = require('fs');
const {promisify} = require('util');//解构赋值
//将 fs.readFile 转化为 promise 风格的函数
const mineReadFile = promisify(fs.readFile);

async function main(){
    try{
        //读取第一个文件的内容
        let one = await mineReadFile(__dirname + '/resource/4.html');
        let two = await mineReadFile(__dirname + '/resource/2.html');
        let three = await mineReadFile(__dirname + '/resource/3.html');
        //拼接
        console.log(one + two + three);
    }catch(e){
        console.log(e);
    }
}




main();